<HTML>
<HEAD>
<TITLE>[Chapter 23] ComponentPeer</TITLE>
<META NAME="author" CONTENT="John Zukowski">
<META NAME="date" CONTENT="Thu Jul 31 15:28:07 1997">
<META NAME="form" CONTENT="html">
<META NAME="metadata" CONTENT="dublincore.0.1">
<META NAME="objecttype" CONTENT="book part">
<META NAME="otheragent" CONTENT="gmat dbtohtml">
<META NAME="publisher" CONTENT="O'Reilly &amp; Associates, Inc.">
<META NAME="source" CONTENT="SGML">
<META NAME="subject" CONTENT="Java AWT">
<META NAME="title" CONTENT="Java AWT">
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">

<DIV CLASS=htmlnav>
<H1><a href='index.htm'><IMG SRC="gifs/smbanner.gif"
     ALT="Java AWT" border=0></a></H1>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch23_05.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><B><FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">Chapter 23<br>java.awt.peer Reference</FONT></B></TD>
<td width=172 align=right valign=top><A HREF="ch23_07.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
</table>

&nbsp;
<hr align=left width=515>
</DIV>
<DIV CLASS=refnamediv>
<H1>ComponentPeer</H1>

<H2>Name</H2>

ComponentPeer

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch23-REFSECT1-AUTOID.25"></A></h2>
</DIV>


<p>
<img align=middle src="./figs/compon4.gif" alt="[Graphic: Figure from the text]" width=502 height=323 border=0>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch23-REFSECT1-AUTOID.26">Description</A></h2>

<P CLASS=para>
<tt CLASS=literal>ComponentPeer</tt> is an interface 
that defines the basis for all non-menu GUI peer interfaces. 

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch23-REFSECT1-AUTOID.27">Interface Definition</A></h2>

<DIV CLASS=screen>
<P>
<PRE>
public abstract interface java.awt.peer.ComponentPeer {
  // Interface Methods
  public abstract int checkImage (Image image, int width, int height, 
    ImageObserver observer);
  public abstract Image createImage (ImageProducer producer);
  public abstract Image createImage (int width, int height);
  public abstract void disable(); <img src="gifs/wstar.gif" alt="(Deprecated)" border=0>
  public abstract void dispose();
  public abstract void enable(); <img src="gifs/wstar.gif" alt="(Deprecated)" border=0>
  public abstract ColorModel getColorModel();
  public abstract FontMetrics getFontMetrics (Font f);
  public abstract Graphics getGraphics();
  public abstract Point getLocationOnScreen(); <img src="gifs/bstar.gif" alt="(New)" border=0>
  public abstract Dimension getMinimumSize(); <img src="gifs/bstar.gif" alt="(New)" border=0>
  public abstract Dimension getPreferredSize(); <img src="gifs/bstar.gif" alt="(New)" border=0>
  public abstract Toolkit getToolkit();
  public abstract boolean handleEvent (Event e);
  public abstract void hide(); <img src="gifs/wstar.gif" alt="(Deprecated)" border=0>
  public abstract boolean isFocusTraversable(); <img src="gifs/bstar.gif" alt="(New)" border=0>
  public abstract Dimension minimumSize(); <img src="gifs/wstar.gif" alt="(Deprecated)" border=0>
  public abstract void paint (Graphics g);
  public abstract Dimension preferredSize (); <img src="gifs/wstar.gif" alt="(Deprecated)" border=0>
  public abstract boolean prepareImage (Image image, int width, int height, 
    ImageObserver observer);
  public abstract void print (Graphics g);
  public abstract void repaint (long tm, int x, int y, int width, int height);
  public abstract void requestFocus();
  public abstract void reshape (int x, int y, int width, int height); <img src="gifs/wstar.gif" alt="(Deprecated)" border=0>
  public abstract void setBackground (Color c);
  public abstract void setBounds (int x, int y, int width, int height); <img src="gifs/bstar.gif" alt="(New)" border=0>
  public abstract void setCursor (Cursor cursor); <img src="gifs/bstar.gif" alt="(New)" border=0>
  public abstract void setEnabled (boolean b); <img src="gifs/bstar.gif" alt="(New)" border=0>
  public abstract void setFont (Font f);
  public abstract void setForeground (Color c);
  public abstract void setVisible (boolean b); <img src="gifs/bstar.gif" alt="(New)" border=0>
  public abstract void show(); <img src="gifs/wstar.gif" alt="(Deprecated)" border=0>
}
</PRE>
</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch23-REFSECT1-AUTOID.28">Interface Methods</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.10">checkImage</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.10">public abstract int checkImage (Image image, int width, int height, ImageObserver observer)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>image</I><br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Image</tt> 
to check.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>width</I><br>
<DD>

<P CLASS=para>
Horizontal size to 
which the image will be scaled.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>height</I><br>
<DD>

<P CLASS=para>
Vertical size to 
which the image will be scaled.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>observer</I><br>
<DD>

<P CLASS=para>
An <tt CLASS=literal>ImageObserver</tt> 
to monitor image loading; normally, the object on which the image will 
be rendered. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>ImageObserver</tt> flags ORed together 
indicating status. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Checks status of image construction. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.11">createImage</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.11">public abstract Image createImage (ImageProducer producer)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>producer</I><br>
<DD>

<P CLASS=para>
An object that 
implements the <tt CLASS=literal>ImageProducer</tt> 
interface to create a new image. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
Newly created image instance. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Creates an <tt CLASS=literal>Image</tt> based upon 
an <tt CLASS=literal>ImageProducer</tt>. </DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.12">public abstract Image createImage (int width, int height)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>width</I><br>
<DD>

<P CLASS=para>
Horizontal size for 
in-memory <tt CLASS=literal>Image</tt>.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>height</I><br>
<DD>

<P CLASS=para>
Vertical size for 
in-memory <tt CLASS=literal>Image</tt>. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
Newly created image instance. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Creates an in-memory <tt CLASS=literal>Image</tt> 
for double buffering. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.12">disable</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.13">public abstract void disable() <img src="gifs/wstar.gif" alt="(Deprecated)" border=0></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Disables component so that it is unresponsive to user interactions. Replaced 
by <tt CLASS=literal>setEnabled(false)</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.13">dispose</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.14">public abstract void dispose()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Releases resources used by peer. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.14">enable</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.15">public abstract void enable() <img src="gifs/wstar.gif" alt="(Deprecated)" border=0></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Enables component so that it is responsive to user interactions. Replaced 
by <tt CLASS=literal>setEnabled(true)</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.15">getColorModel</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.16">public abstract ColorModel getColorModel()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>ColorModel</tt> used to display 
the current component. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.16">getFontMetrics</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.17">public abstract FontMetrics getFontMetrics (Font f)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>f</I><br>
<DD>

<P CLASS=para>
A font whose metrics 
are desired. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
Font sizing information for the desired font. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.17">getGraphics</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.18">public abstract Graphics getGraphics()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>InternalException</I><br>
<DD>

<P CLASS=para>
If 
acquiring a graphics context is unsupported </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
Component's graphics context. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.18">getLocationOnScreen</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.19">public abstract Point getLocationOnScreen() <img src="gifs/bstar.gif" alt="(New)" border=0></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The location of the component in the screen's coordinate space. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.19">getMinimumSize</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.20">public abstract Dimension getMinimumSize() <img src="gifs/bstar.gif" alt="(New)" border=0></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The minimum dimensions of the component. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.20">getPreferredSize</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.21">public abstract Dimension getPreferredSize() <img src="gifs/bstar.gif" alt="(New)" border=0></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The preferred dimensions of the component. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.21">getToolkit</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.22">public abstract Toolkit getToolkit()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Toolkit</tt> of <tt CLASS=literal>Component</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.22">handleEvent</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.23">public abstract boolean handleEvent (Event e)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>e</I><br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Event</tt> 
instance identifying what caused the method to be called. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>true</tt> if the peer handled the 
event, <tt CLASS=literal>false</tt> to propagate the 
event to the parent container. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
High-level event handling routine. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.23">hide</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.24">public abstract void hide() <img src="gifs/wstar.gif" alt="(Deprecated)" border=0></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Hides the component. Replaced by <tt CLASS=literal>setVisible(false)</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.24">isFocusTraversable</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.25">public abstract boolean isFocusTraversable() <img src="gifs/bstar.gif" alt="(New)" border=0></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>true</tt> if the peer can be tabbed 
onto, <tt CLASS=literal>false</tt> otherwise. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Determines if this peer is navigable using the keyboard. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.25">minimumSize</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.26">public abstract Dimension minimumSize() <img src="gifs/wstar.gif" alt="(Deprecated)" border=0></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The minimum dimensions of the component. Replaced by <tt CLASS=literal>getMinimumSize()</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.26">paint</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.27">public abstract void paint (Graphics g)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>g</I><br>
<DD>

<P CLASS=para>
Graphics context of the 
component. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Draws something in graphics context. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.27">preferredSize</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.28">public abstract Dimension preferredSize() <img src="gifs/wstar.gif" alt="(Deprecated)" border=0></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The preferred dimensions of the component. Replaced by <tt CLASS=literal>getPreferredSize()</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.28">prepareImage</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.29">public abstract boolean prepareImage (Image image, int width, int height, ImageObserver observer)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>image</I><br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Image</tt> 
to load.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>width</I><br>
<DD>

<P CLASS=para>
Horizontal size to 
which the image will be scaled.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>height</I><br>
<DD>

<P CLASS=para>
Vertical size to 
which the image will be scaled.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>observer</I><br>
<DD>

<P CLASS=para>
An <tt CLASS=literal>ImageObserver</tt> 
to monitor image loading; normally, the object on which the image will 
be rendered. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>true</tt> if the image has already 
loaded, <tt CLASS=literal>false</tt> otherwise. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Forces the image to start loading. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.29">print</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.30">public abstract void print (Graphics g)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>g</I><br>
<DD>

<P CLASS=para>
Graphics context of component. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Print something from the graphics context. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.30">repaint</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.31">public abstract void repaint (long tm, int x, int y, int width, int height)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>tm</I><br>
<DD>

<P CLASS=para>
Millisecond delay allowed 
before repaint.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>x</I><br>
<DD>

<P CLASS=para>
Horizontal origin of 
bounding box to redraw.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>y</I><br>
<DD>

<P CLASS=para>
Vertical origin of bounding 
box to redraw.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>width</I><br>
<DD>

<P CLASS=para>
Width of bounding 
box to redraw.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>height</I><br>
<DD>

<P CLASS=para>
Height of bounding 
box to redraw. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Requests scheduler to redraw portion of component within a time period. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.31">requestFocus</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.32">public abstract void requestFocus()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Requests this <tt CLASS=literal>Component</tt> gets 
the input focus. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.32">reshape</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.33">public abstract void reshape (int x, int y, int width, int height) <img src="gifs/wstar.gif" alt="(Deprecated)" border=0></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>x</I><br>
<DD>

<P CLASS=para>
New horizontal position 
for component.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>y</I><br>
<DD>

<P CLASS=para>
New vertical position 
for component.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>width</I><br>
<DD>

<P CLASS=para>
New width for component.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>height</I><br>
<DD>

<P CLASS=para>
New height for component. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Relocates and resizes the component's peer. Replaced by <tt CLASS=literal>setBounds(int, 
int, int, int)</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.33">setBackground</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.34">public abstract void setBackground (Color c)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>c</I><br>
<DD>

<P CLASS=para>
New color for the background. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Changes the background color of the component. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.34">setBounds</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.35">public abstract void setBounds (int x, int y, int width, int height) <img src="gifs/bstar.gif" alt="(New)" border=0></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>x</I><br>
<DD>

<P CLASS=para>
New horizontal position 
for component.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>y</I><br>
<DD>

<P CLASS=para>
New vertical position 
for component.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>width</I><br>
<DD>

<P CLASS=para>
New width for component.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>height</I><br>
<DD>

<P CLASS=para>
New height for component. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Relocates and resizes the component's peer. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.35">setCursor</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.36">public abstract void setCursor (Cursor cursor) <img src="gifs/bstar.gif" alt="(New)" border=0></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>cursor</I><br>
<DD>

<P CLASS=para>
New 
cursor. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Changes the cursor of the component. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.36">setEnabled</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.37">public abstract void setEnabled (boolean b) <img src="gifs/bstar.gif" alt="(New)" border=0></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>b</I><br>
<DD>

<P CLASS=para>
<tt CLASS=literal>true</tt> 
to enable the peer; <tt CLASS=literal>false</tt> to 
disable it. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Enables or disables the peer. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.37">setFont</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.38">public abstract void setFont (Font f)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>f</I><br>
<DD>

<P CLASS=para>
New font for the component. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Changes the font used to display text in the component. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.38">setForeground</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.39">public abstract void setForeground (Color c)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>c</I><br>
<DD>

<P CLASS=para>
New foreground color 
for the component. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Changes the foreground color of the component. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.39">setVisible</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.40">public abstract void setVisible (boolean b) <img src="gifs/bstar.gif" alt="(New)" border=0></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>b</I><br>
<DD>

<P CLASS=para>
<tt CLASS=literal>true</tt> 
to show the peer; <tt CLASS=literal>false</tt> to 
hide it. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Shows or hides the peer. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch23-REFSECT2-AUTOID.40">show</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch23-REFSECT3-AUTOID.41">public abstract void show() <img src="gifs/wstar.gif" alt="(Deprecated)" border=0></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Makes the peer visible. Replaced by <tt CLASS=literal>setVisible(true)</tt>. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch23-REFSECT1-AUTOID.29">See Also</A></h2>

<P CLASS=para>
<tt CLASS=literal>ButtonPeer</tt>, <tt CLASS=literal>CanvasPeer</tt>, 
<tt CLASS=literal>CheckboxPeer</tt>, <tt CLASS=literal>ChoicePeer</tt>, 
<tt CLASS=literal>Color</tt>, <tt CLASS=literal>ColorModel</tt>, 
<tt CLASS=literal>ContainerPeer</tt>, Cursor, 
<tt CLASS=literal>Dimension</tt>, <tt CLASS=literal>Event</tt>, 
<tt CLASS=literal>Font</tt>, <tt CLASS=literal>FontMetrics</tt>, 
<tt CLASS=literal>Graphics</tt>, <tt CLASS=literal>Image</tt>, 
<tt CLASS=literal>ImageObserver</tt>, <tt CLASS=literal>ImageProducer</tt>, 
<tt CLASS=literal>LabelPeer</tt>, <tt CLASS=literal>ListPeer</tt>, 
<tt CLASS=literal>ScrollbarPeer</tt>, <tt CLASS=literal>TextComponentPeer</tt>, 
<tt CLASS=literal>Toolkit</tt> 

</DIV>


<DIV CLASS=htmlnav>

<P>
<HR align=left width=515>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch23_05.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><a href="index.htm"><img src='gifs/txthome.gif' border=0 alt='Home'></a></td>
<td width=172 align=right valign=top><A HREF="ch23_07.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
<tr>
<td width=172 align=left valign=top>ChoicePeer</td>
<td width=171 align=center valign=top><a href="index/idx_a.htm"><img src='gifs/index.gif' alt='Book Index' border=0></a></td>
<td width=172 align=right valign=top>ContainerPeer</td>
</tr>
</table>
<hr align=left width=515>

<IMG SRC="gifs/smnavbar.gif" USEMAP="#map" BORDER=0> 
<MAP NAME="map"> 
<AREA SHAPE=RECT COORDS="0,0,108,15" HREF="../javanut/index.htm"
alt="Java in a Nutshell"> 
<AREA SHAPE=RECT COORDS="109,0,200,15" HREF="../langref/index.htm" 
alt="Java Language Reference"> 
<AREA SHAPE=RECT COORDS="203,0,290,15" HREF="../awt/index.htm" 
alt="Java AWT"> 
<AREA SHAPE=RECT COORDS="291,0,419,15" HREF="../fclass/index.htm" 
alt="Java Fundamental Classes"> 
<AREA SHAPE=RECT COORDS="421,0,514,15" HREF="../exp/index.htm" 
alt="Exploring Java"> 
</MAP>
</DIV>

</BODY>
</HTML>
